package com.wjc.basemodule.widget

import android.content.Context
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleObserver
import androidx.lifecycle.OnLifecycleEvent
import com.wjc.basemodule.utils.LogTools

/**
 * ClassName: com.wjc.widget
 * Description:
 * JcChen on 2022.07.04.17:39
 */
class DialogManagerKt(val context: String) : LifecycleObserver {
    val TAG = "DialogManagerKt"
    private val showLog = true

    @OnLifecycleEvent(Lifecycle.Event.ON_ANY)
    fun onAny() {
//        if (showLog)
//            LogTools.d(TAG, ":OnAny --$context");
    }

    @OnLifecycleEvent(Lifecycle.Event.ON_CREATE)
    fun onCreate() {
        if (showLog)

            LogTools.i(TAG, ":ON_CREATE --$context");
    }

    @OnLifecycleEvent(Lifecycle.Event.ON_START)
    fun onStart() {
        if (showLog)

            LogTools.d(TAG, ":ON_START --$context");
    }

    @OnLifecycleEvent(Lifecycle.Event.ON_RESUME)
    fun onResume() {
        if (showLog)
            LogTools.i(TAG, ":ON_RESUME --$context");
    }

    @OnLifecycleEvent(Lifecycle.Event.ON_PAUSE)
    fun onPause() {
        if (showLog)
            LogTools.d(TAG, ":ON_PAUSE --$context");
    }

    @OnLifecycleEvent(Lifecycle.Event.ON_STOP)
    fun onStop() {
        if (showLog)
            LogTools.i(TAG, ":ON_STOP --$context");
    }

    @OnLifecycleEvent(Lifecycle.Event.ON_DESTROY)
    fun onDestroy() {
        if (showLog)
            LogTools.d(TAG, ":ON_DESTROY --$context");
    }
}